package com.lf.lexy.controller.rec;

import java.util.HashMap;
import java.util.List;

import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;
import com.lf.comm.MyConstants;
import com.lf.lexy.business.BlogBusiness;
import com.lf.lexy.controller.BaseController;
import com.lf.lexy.dao.BlogContentDao;
import com.lf.lexy.model.BlogContent;

public class BlogController extends BaseController {

	private BlogBusiness blogBusiness = new BlogBusiness();

	public void index(){
		List<Record> blogTypeList = blogBusiness.getBlogTypeList("999999");
		setAttr("blogTypeList", blogTypeList);
		Page<BlogContent> blogContentList = blogBusiness.getBlogContentList("999999" , "" , "1" ,MyConstants.PAGE_SIZE_REC);
		setAttr("bloglist", blogContentList);
		setAttr("enFlag", MyConstants.ENFLAG);
//		render("rec_index.jsp");
		render("rec_index.jsp");
	}
	
	public void getBlogContent(){
		
		String serialId = getPara("serialId");
		
		BlogContent geetBlogContentByPK = BlogContentDao.me.geetBlogContentByPK(serialId);
		setAttr("blog", geetBlogContentByPK);
		
		render("rec_blog_content.jsp");
		
	}
	
}
